﻿<div>
    @foreach (var item in FixedModel)
    {
        <MChip Class="ma-1" OnClick="()=>OnClick(item)" Small
                Color="primary"
               Outlined="!InputData.Any(s=>s==item)">
            @item.GetDisplayName()
        </MChip>
    }

</div>

@code {
    [Parameter]
    public List<SearchType> InputData { get; set; }
    [Parameter]
    public List<SearchType> FixedModel { get; set; }
    [Parameter]
    public EventCallback OnChanged { get; set; }

    public async Task OnClick(SearchType model)
    {
        if (InputData.Any(s => s == model))
        {
            InputData.Remove(model);
        }
        else
        {
            InputData.Add(model);
        }



       StateHasChanged();
      await  OnChanged.InvokeAsync();
    }

}
